#ifndef QUIRREL_EDITOR_EXTENSION_HPP
#define QUIRREL_EDITOR_EXTENSION_HPP

#include "scripting/scripting_api.h"
#include <string_view>

struct QuirrelEditorExtensionPrivate;
class QuirrelEditorExtension final: public IEditorScript {
private:
    QuirrelEditorExtension(IEditorScript::EditorTarget type, std::string title, std::string script_path);
    ~QuirrelEditorExtension();
public:
    void execute(const void *data) override;
    static IScript* create(IEditorScript::EditorTarget target, std::string title, std::string path, const std::string_view &code);

private:
    bool compile(const std::string_view& code) const;

    QuirrelEditorExtensionPrivate* const d;
};

#endif /* QUIRREL_EDITOR_EXTENSION_HPP */
